//
//  MarketData.h
//  AppFinance
//
//  Created by wei on 12-6-10.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface AFMarketData : NSObject
{
    NSString *lastClose;
    
    float last_KLineMinH;   // 最小高度
    
    float last_KLineHigh;   // 最高点
    float last_KLineLow;    // 最低点
    int startIndex;
    int DrawCount;
}

+(AFMarketData*) data;

// ----------------------------- [S] 分时数据 ------------------------------------
@property(nonatomic, retain) NSMutableArray *serverTimeListArray;

@property(nonatomic, retain) NSMutableArray *drawTimeListArray;         // 分时绘制坐标
@property(nonatomic, retain) NSMutableArray *drawTimeAverageListArray;  // 分时均线
@property(nonatomic, retain) NSMutableArray *drawTimeVolumeListArray;   // 分时交易量绘制坐标
@property(nonatomic) float timeHigh;
@property(nonatomic) float timeLow;
@property(nonatomic) float timeMaxVolume;

@property(nonatomic) int draw;
@property (nonatomic) NSString * code_decimal;

-(void) lastClose:(NSString*)_close;
-(void) timeRemoveDrawListArray;
-(void) initServerTimeListArray:(NSArray *)_array;
-(void) serverTimeDataToLocalTimeData;

-(NSDictionary*) timeCurrentPointInfo:(float)_x;
// ----------------------------- [E] 分时数据 ------------------------------------


// ---------------------------- [S] KLine数据 -----------------------------------
// 原始数据 转换 为 坐标点数据
-(NSMutableArray*)serverKLineDataToLocalKLineDataWithArray:(NSArray*)kLineArray;

-(void) serverKLineDataToMALocal:(NSArray*)kLineArray;

-(float)lastKLineMinH;
-(float)lastKLineHigh;
-(float)lastKLineLow;
-(void)drawMAStartIndex:(int)_startIndex withDrawCount:(int)_drawCount;
@property(nonatomic, retain) NSMutableArray *drawMA5ListArray;   // MA5绘制坐标
@property(nonatomic, retain) NSMutableArray *drawMA10ListArray;  // MA10绘制坐标
@property(nonatomic, retain) NSMutableArray *drawMA20ListArray;  // MA20绘制坐标

// ---------------------------- [E] KLine数据 -----------------------------------
@end
